<?php
declare(strict_types=1);

class c_crontab
{
    private string $url = 'http://senyimiao.com/?c=rpc_server&m=server_handle';
    public function index()
    {
        $queue = new m_queue();
        $queue_data = $queue->where('status',0)->field('class,method,id')->limit(10)->select();
        if(!count($queue_data)) return false;
        foreach($queue_data as $queue_item){
            Yar_Concurrent_Client::call($this->url, 'run', [$queue_item['class'],$queue_item['method'],$queue_item['id']]);
        }
        Yar_Concurrent_Client::loop();
    }
}